<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class TestEmail extends Mailable
{
    use Queueable, SerializesModels;


    // 这个值自动回传递到页面，还可以用with传递数据，但是会被public属性覆盖
    public $content;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct()
    {
      //
      $this->content = 'text shuxing';
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
      return $this->view('email.wechat.subscribe')
              ->attachData('i am pdf', 'name.txt', [
                'mime' => 'application/txt',
              ]);;
    }
}
